//
// Decompiled by Jadx - 468ms
//
package me.plusne.Adapter.Login;

import android.app.Activity;
import android.view.View;
import com.google.gson.Gson;
import fg.n;
import fi.a;
import fi.c;
import fi.e;
import fi.w;
import fn.b;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import me.plusne.Adapter.Login.HookSetListAdapter;
import me.plusne.common.Json.Login.JsonHookList;
import me.plusne.common.Json.Login.JsonHookListEdit;
import me.plusne.common.Json.Login.JsonHookSetAddValue;
import me.plusne.common.Json.Login.JsonHookSlider;
import me.plusne.common.Json.Login.JsonHookTouch;
import me.plusne.common.Json.Login.JsonLoginQuerySet;
import r.f;

public final class d implements View.OnClickListener {
    public final int a;
    public final HookSetListAdapter.a b;
    public final JsonLoginQuerySet.SetBean c;
    public final HookSetListAdapter d;

    public d(HookSetListAdapter.a aVar, JsonLoginQuerySet.SetBean setBean, HookSetListAdapter hookSetListAdapter, int i) {
        this.a = i;
        this.b = aVar;
        this.c = setBean;
        this.d = hookSetListAdapter;
    }

    @Override
    public final void onClick(View view) {
        f fVar;
        String str;
        int i = this.a;
        JsonLoginQuerySet.SetBean setBean = this.c;
        HookSetListAdapter hookSetListAdapter = this.d;
        HookSetListAdapter.a aVar = this.b;
        switch (i) {
            case 0:
                aVar.getClass();
                if (HookSetListAdapter.a.j(setBean, hookSetListAdapter.c)) {
                    JsonHookListEdit jsonHookListEdit = (JsonHookListEdit) new Gson().fromJson(setBean.getType_value(), JsonHookListEdit.class);
                    if (jsonHookListEdit == null) {
                        jsonHookListEdit = new JsonHookListEdit();
                    }
                    w wVar = new w(hookSetListAdapter.c);
                    wVar.bj(fi.e.LIST_EDIT);
                    wVar.aj = jsonHookListEdit.getTitle();
                    wVar.bb();
                    wVar.ak = jsonHookListEdit.getDesc();
                    wVar.bb();
                    wVar.at = jsonHookListEdit.isFile();
                    wVar.o = jsonHookListEdit.isDirectory() ? null : (String[]) jsonHookListEdit.getFileType().toArray(new String[0]);
                    List list = (List) new Gson().fromJson(b.g(setBean.getKey(), ""), new i().getType());
                    if (list != null) {
                        Iterator it = list.iterator();
                        while (it.hasNext()) {
                            wVar.ad.add(new a(((a) it.next()).getKey()));
                        }
                    }
                    wVar.ac = new f(aVar, setBean, hookSetListAdapter, 0);
                    wVar.bk();
                    return;
                }
                return;
            case 1:
                aVar.getClass();
                if (HookSetListAdapter.a.j(setBean, hookSetListAdapter.c)) {
                    Activity activity = hookSetListAdapter.c;
                    w wVar2 = new w(activity);
                    wVar2.bj(fi.e.TOUCH);
                    JsonHookTouch jsonHookTouch = (JsonHookTouch) new Gson().fromJson(setBean.getType_value(), JsonHookTouch.class);
                    if (jsonHookTouch != null && jsonHookTouch.getListSelect() != null) {
                        wVar2.bi(jsonHookTouch.getTitle());
                        wVar2.bc(jsonHookTouch.getDesc());
                        List<a> list2 = (List) new Gson().fromJson(b.g(setBean.getKey(), ""), new j().getType());
                        ArrayList arrayList = wVar2.ad;
                        if (list2 == null || list2.size() != 9) {
                            for (int i2 = 0; i2 < 9; i2++) {
                                arrayList.add(new a(""));
                            }
                        } else {
                            for (a aVar2 : list2) {
                                arrayList.add(new a(aVar2.getKey(), aVar2.getValue()));
                            }
                        }
                        wVar2.as = new g(hookSetListAdapter, jsonHookTouch, wVar2, 0);
                        wVar2.v = new n(aVar, setBean, wVar2, hookSetListAdapter);
                        wVar2.bk();
                        return;
                    }
                    f fVar2 = new f(activity);
                    fVar2.d = 80;
                    fVar2.j();
                    fVar2.l("没有九宫格数据,请联系作者");
                    return;
                }
                return;
            case 2:
                aVar.getClass();
                if (HookSetListAdapter.a.j(setBean, hookSetListAdapter.c)) {
                    JsonHookListEdit jsonHookListEdit2 = (JsonHookListEdit) new Gson().fromJson(setBean.getType_value(), JsonHookListEdit.class);
                    if (jsonHookListEdit2 == null) {
                        jsonHookListEdit2 = new JsonHookListEdit();
                    }
                    w wVar3 = new w(hookSetListAdapter.c);
                    wVar3.bj(fi.e.LIST_EDIT_KEY);
                    wVar3.aj = jsonHookListEdit2.getTitle();
                    wVar3.bb();
                    wVar3.ak = jsonHookListEdit2.getDesc();
                    wVar3.bb();
                    wVar3.at = jsonHookListEdit2.isFile();
                    wVar3.o = jsonHookListEdit2.isDirectory() ? null : (String[]) jsonHookListEdit2.getFileType().toArray(new String[0]);
                    List list3 = (List) new Gson().fromJson(b.g(setBean.getKey(), ""), new k().getType());
                    if (list3 != null) {
                        Iterator it2 = list3.iterator();
                        while (it2.hasNext()) {
                            wVar3.ad.add(new a(((a) it2.next()).getKey()));
                        }
                    }
                    wVar3.ac = new f(aVar, setBean, hookSetListAdapter, 6);
                    wVar3.bk();
                    return;
                }
                return;
            case 3:
                aVar.getClass();
                if (HookSetListAdapter.a.j(setBean, hookSetListAdapter.c)) {
                    JsonHookSlider jsonHookSlider = (JsonHookSlider) new Gson().fromJson(setBean.getType_value(), JsonHookSlider.class);
                    Activity activity2 = hookSetListAdapter.c;
                    if (jsonHookSlider == null) {
                        f fVar3 = new f(activity2);
                        fVar3.d = 80;
                        fVar3.j();
                        fVar3.l("没有滑块条数据,请联系作者");
                        return;
                    }
                    w wVar4 = new w(activity2);
                    wVar4.bj(fi.e.SLIDER);
                    wVar4.aj = jsonHookSlider.getTitle();
                    wVar4.bb();
                    int min = jsonHookSlider.getMin();
                    int max = jsonHookSlider.getMax();
                    int f = b.f(0, setBean.getKey());
                    wVar4.an = min;
                    wVar4.ao = max;
                    wVar4.am = f - min;
                    wVar4.ak = jsonHookSlider.getDesc();
                    wVar4.bb();
                    wVar4.z = jsonHookSlider.getPosTitle();
                    wVar4.v = new f(aVar, setBean, hookSetListAdapter, 1);
                    wVar4.bk();
                    return;
                }
                return;
            case 4:
                aVar.getClass();
                if (HookSetListAdapter.a.j(setBean, hookSetListAdapter.c)) {
                    JsonHookSetAddValue jsonHookSetAddValue = (JsonHookSetAddValue) new Gson().fromJson(setBean.getType_value(), JsonHookSetAddValue.class);
                    Activity activity3 = hookSetListAdapter.c;
                    if (jsonHookSetAddValue == null) {
                        f fVar4 = new f(activity3);
                        fVar4.d = 80;
                        fVar4.j();
                        fVar4.l("选择文件Json数据错误,请联系作者");
                        return;
                    }
                    w wVar5 = new w(activity3);
                    wVar5.bj(fi.e.SELECT_FILE);
                    wVar5.o = jsonHookSetAddValue.isFile() ? (String[]) jsonHookSetAddValue.getFileType().toArray(new String[0]) : null;
                    wVar5.bf(b.g(setBean.getKey(), ""));
                    wVar5.x = new f(aVar, setBean, hookSetListAdapter, 2);
                    wVar5.bk();
                    return;
                }
                return;
            case 5:
                aVar.getClass();
                if (HookSetListAdapter.a.j(setBean, hookSetListAdapter.c)) {
                    JsonHookSetAddValue jsonHookSetAddValue2 = (JsonHookSetAddValue) new Gson().fromJson(setBean.getType_value(), JsonHookSetAddValue.class);
                    if (jsonHookSetAddValue2 == null) {
                        jsonHookSetAddValue2 = new JsonHookSetAddValue();
                    }
                    w wVar6 = new w(hookSetListAdapter.c);
                    wVar6.bj(fi.e.INPUT);
                    wVar6.ag = jsonHookSetAddValue2.getHint();
                    wVar6.aj = jsonHookSetAddValue2.getTitle();
                    wVar6.bb();
                    wVar6.ah = jsonHookSetAddValue2.getInputType();
                    wVar6.k = b.g(setBean.getKey(), setBean.getDefaultValue());
                    wVar6.ak = jsonHookSetAddValue2.getDesc();
                    wVar6.bb();
                    wVar6.w = new f(aVar, setBean, hookSetListAdapter, 4);
                    wVar6.bk();
                    return;
                }
                return;
            case 6:
                aVar.getClass();
                if (HookSetListAdapter.a.j(setBean, hookSetListAdapter.c)) {
                    JsonHookSetAddValue jsonHookSetAddValue3 = (JsonHookSetAddValue) new Gson().fromJson(setBean.getType_value(), JsonHookSetAddValue.class);
                    if (jsonHookSetAddValue3 == null) {
                        jsonHookSetAddValue3 = new JsonHookSetAddValue();
                    }
                    w wVar7 = new w(hookSetListAdapter.c);
                    wVar7.bj(fi.e.INPUT_MULTI);
                    wVar7.ag = jsonHookSetAddValue3.getHint();
                    wVar7.aj = jsonHookSetAddValue3.getTitle();
                    wVar7.bb();
                    wVar7.k = b.g(setBean.getKey(), setBean.getDefaultValue());
                    wVar7.ak = jsonHookSetAddValue3.getDesc();
                    wVar7.bb();
                    wVar7.w = new f(aVar, setBean, hookSetListAdapter, 3);
                    wVar7.bk();
                    return;
                }
                return;
            default:
                aVar.getClass();
                if (HookSetListAdapter.a.j(setBean, hookSetListAdapter.c)) {
                    JsonHookList jsonHookList = (JsonHookList) new Gson().fromJson(setBean.getType_value(), JsonHookList.class);
                    Activity activity4 = hookSetListAdapter.c;
                    if (jsonHookList == null) {
                        fVar = new f(activity4);
                        fVar.d = 80;
                        fVar.j();
                        str = "没有数据可选择,请联系作者";
                    } else {
                        c cVar = new c();
                        cVar.setList(new ArrayList());
                        cVar.setTitle("");
                        cVar.setGroup(false);
                        cVar.setGravity(8388611);
                        if (jsonHookList.getList() == null) {
                            fVar = new f(activity4);
                            fVar.d = 80;
                            fVar.j();
                            str = "没有List数据可选择,请联系作者";
                        } else {
                            for (JsonHookList.ListBean listBean : jsonHookList.getList()) {
                                String title = listBean.getTitle();
                                String desc = listBean.getDesc();
                                String value = listBean.getValue();
                                c.a aVar3 = new c.a();
                                aVar3.setTitle(title);
                                aVar3.setDesc(desc);
                                aVar3.setKey(value);
                                aVar3.setRightText((String) null);
                                aVar3.setArrow(false);
                                aVar3.setHideArrow(false);
                                cVar.getList().add(aVar3);
                            }
                            w wVar8 = new w(activity4);
                            wVar8.bj(fi.e.LIST_ITEM);
                            wVar8.aj = jsonHookList.getTitle();
                            wVar8.bb();
                            wVar8.ak = jsonHookList.getDesc();
                            wVar8.bb();
                            wVar8.aq.add(cVar);
                            fg.b bVar = wVar8.y;
                            if (bVar != null) {
                                bVar.notifyItemChanged(r13.size() - 1);
                            }
                            wVar8.ae = new f(aVar, setBean, hookSetListAdapter, 5);
                            wVar8.bk();
                            return;
                        }
                    }
                    fVar.l(str);
                    return;
                }
                return;
        }
    }
}
